import axios from '@/axios'
enum API {
    ROUTE_GETALL = '/getRouteAll',
    ROUTE_GETPAGE = '/getRoutePage',
    ROUTE_GETKEYPAGE = '/SearchRouteKey',
    ROUTE_UPDATEBYID = '/updataRouteById',
    ROUTE_DELETEBYID = '/deleteRouteById',
    ROUTE_DELETEMOREBYID = '/deleteRouteMoreById',
    ROUTE_ADD = '/addRoute',
}
// 获取所有路由信息
export const getRouteAllAPI = () => axios.get(API.ROUTE_GETALL)
// 分页查询路由
export const getRoutePageAPI = (data: any) => axios.post(API.ROUTE_GETPAGE, data)
// 指定key-value分页查询路由
export const getRouteKeyPageAPI = (data: any) => axios.post(API.ROUTE_GETKEYPAGE, data)
// 根据id更新路由
export const UpdateRouteByIdAPI = (data: any) => axios.post(API.ROUTE_UPDATEBYID, data)
// 根据id删除路由
export const DeleteRouteByIdAPI = (id: string) => axios.delete(`${API.ROUTE_DELETEBYID}/${id}`)
// 根据id批量路由
export const DeleteRouteMoreByIdAPI = (ids: any) => axios.post(API.ROUTE_DELETEMOREBYID, ids)
// 添加路由
export const AddRouteAPI = (data: any) => axios.post(API.ROUTE_ADD, data)